import time
from driving_route_planning import driving_route_planning
from location import location
from map import map

if __name__ == "__main__":
    # 配置信息
    AK = "hY4gToxg2UFjy5boSBxH6mw9zMITrzNB"
    SK = "FOlVpUY0IpPXUTOkeh5hkp6lY9GhLf4g"
    origin = '29.60083,106.453264'
    destination = '29.612624,106.338693'

    # location(AK, SK)
    # exit()

    start = time.time()
    distance, duration, score, paths = driving_route_planning(AK, SK, origin, destination)
    end = time.time()
    
    
    print ("paths", paths)
    print ()

    print ("driving_route_planning total time", end - start)
    print ("distance", distance)
    print ("duration", duration)
    print ("score", score)

    #start = time.time()
    #route_map(AK, SK, paths)
    #end = time.time()
    tmp0 = paths.split("|")
    print (tmp0)
    tmp1 = []
    for x in tmp0:
        tmp1 += x.split(";")
    tmp2 = []
    for x in tmp1:
        tmp2.append([float(x.split(",")[1]), float(x.split(",")[0])])
    coordinates = tmp2
    map(coordinates)

    